#include <string>
#include <stdio.h>
#include <map>
#include <stdlib.h>
#include <iostream>
#include <string>
using namespace std;

map<string,int> word;
map<string,int>::iterator pos;
int num;

char ins[70];
string tmp;
int n;

bool isword(char &ch)
{
    if (ch>='a' && ch <='z') return true;
    if (ch>='A' && ch <='Z') 
    {
        ch = 'a' + ch-'A';
        return true;
    }    
    return false;
}    

int main()
{
    int len, site, j;
    int first=1;
    
    
    while ( scanf("%d", &n)!=EOF)
    {
        num = 0; 
        while (1)
        {
            do
            {
               scanf("%c", &ins[0]);
            }while (!isword(ins[0]));
            len=0;
            do
            {
            	len++;
            	scanf("%c", &ins[len]);
            }while (isword(ins[len]));    
            ins[len]=0;
            if (strcmp(ins,"endoftext")==0) break;
            tmp = ins;
            word[tmp] ++;
            
        }   

        if (first) first=0;
        else cout << endl;
      
        j = 0;
        for (pos=word.begin(); pos!=word.end(); ++pos)
        	if (pos->second == n)
        	{
          		cout << pos->first << endl;
          		j = 1;
            }  		
        if (j == 0) cout <<"There is no such word." << endl; 
      
       	word.clear(); 		
    }    
	    
    
    return 0;
}    